package com.stk.doublebreak;

import org.andengine.engine.handler.physics.PhysicsHandler;
import org.andengine.entity.modifier.LoopEntityModifier;
import org.andengine.entity.modifier.RotationModifier;
import org.andengine.entity.primitive.Line;
import org.andengine.entity.primitive.Rectangle;
import org.andengine.opengl.vbo.VertexBufferObjectManager;

import android.graphics.Point;
import android.util.Log;

public class Segment extends Line{

	private PhysicsHandler physicsHandler;

	public Segment(float pX1, float pY1, float pX2, float pY2,float pLineWidth,VertexBufferObjectManager pVertexBufferObjectManager, float speed, int screenWidth, int screenHeight) {
		super(pX1, pY1, pX2, pY2, pLineWidth, pVertexBufferObjectManager);
		this.physicsHandler = new PhysicsHandler(this);
        this.registerUpdateHandler(this.physicsHandler);
        this.physicsHandler.setVelocity(speed, (speed * screenHeight) / screenWidth );
        
		this.registerEntityModifier(new LoopEntityModifier(new RotationModifier(5, 0, 360)));
	}
}
